home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / fdate42a.zip / TIC.BAT < prev   
DOS Batch File  |  1992-01-06  |  4KB  |  93 lines

  1. @echo off
  2. REM TicBAT points to the tickler batch file
  3. set TicBAT=C:\TICKLER.BAT
  4. set ticdat=
  5. set ticmsg=
  6. set tictmp=
  7.  
  8. if (%1)==() goto HELP
  9. if (%2)==() goto LIST
  10.  
  11. :ADD
  12. rem -------------------------------------------------------------
  13. rem use a batch file to set ticdat, because it will display full error
  14. rem message if bad date has been passed in via parm %1
  15. rem -------------------------------------------------------------
  16. Fdate /Ff /A%1 /Imm-dd-yy /Omm-dd-ccyy /P"@set ticdat=">junktemp.BAT
  17. call junktemp.BAT
  18. del  junktemp.BAT
  19. if errorlevel 1 goto endit
  20.  
  21. set tictmp=%0 %1
  22. shift
  23. set ticmsg=%1 %2 %3 %4 %5 %6 %7 %8 %9
  24.  
  25. for %%v in ( 1 2 3 4 5 6 7 8 9) do shift
  26. set ticmsg=%ticmsg% %1 %2 %3 %4 %5 %6 %7 %8 %9
  27.  
  28. echo if (%%today%%)==(%ticdat%) echo %ticmsg%>>%TicBAT%
  29. CLS
  30. %tictmp%
  31. goto endit
  32.  
  33.  
  34. :HELP
  35. echo ┌─────────────────────────────────────────────────────────────────────────────┐
  36. echo │                              TIC.BAT                                        │
  37. echo │─────────────────────────────────────────────────────────────────────────────│
  38. echo │  FUNCTION: maintains and lists TICKLER.BAT an automated tickler file.       │
  39. echo │            If TICKLER.BAT does not exist, or has been erased, a new one     │
  40. echo │            will be created.                                                 │
  41. echo │                                                                             │
  42. echo │─────────────────────────────────────────────────────────────────────────────│
  43. echo │  USAGE   : TIC           displays this HELP screen                          │
  44. echo │─────────────────────────────────────────────────────────────────────────────│
  45. echo │  USAGE   : TIC T         displays today's appointments                      │
  46. echo │  USAGE   : TIC TODAY     displays today's appointments                      │
  47. echo │─────────────────────────────────────────────────────────────────────────────│
  48. echo │  USAGE   : TIC mm/dd/yy  displays appointments for date mm/dd/yy            │
  49. echo │  EXAMPLE : TIC 2/2/92    displays appointments for Feb 2, 1992              │
  50. echo │  EXAMPLE : TIC 2/2/tt    displays appointments for Feb 2 of this year       │
  51. echo │─────────────────────────────────────────────────────────────────────────────│
  52. echo │  USAGE   : TIC mm/dd/yy  word1 .... word 18   adds a date mm/dd/yy and      │
  53. echo │                                               description to TICKLER.BAT    │
  54. echo │  EXAMPLE : TIC 2/2/92    Quality Improvement committee meeting @ 10 am      │
  55. echo │  EXAMPLE : TIC 2/2/tt    Quality Improvement committee meeting @ 10 am      │
  56. echo └─────────────────────────────────────────────────────────────────────────────┘
  57. goto endit
  58.  
  59.  
  60. REM ==================================================================
  61. :LIST
  62. if not exist %TicBAT% goto endit
  63.  
  64. rem ------------- call a batch file to set TODAY evar ------------
  65.     Fdate /Ff /A%1 /Imm-dd-yy /Omm-dd-ccyy /P"@set today=">junktemp.BAT
  66.     call junktemp.BAT
  67.     del  junktemp.BAT
  68. rem --------------------------------------------------------------
  69.  
  70. : If you have GET, you can replace the previous lines with these.
  71. : Remove the ":" from before the FDATE command and things should
  72. : work fine.  Use :, not REM to comment out lines that contain
  73. : the DOS pipe symbol "|".  Otherwise you may hang your machine.
  74. rem -------- pipe Fdate output to GET to set TODAY evar ----------
  75. :   Fdate /Ff /A%1 /Imm-dd-yy /Omm-dd-ccyy | GET ZE /Vtoday >nul
  76. rem --------------------------------------------------------------
  77.  
  78.  
  79. if (%today%)==(ERROR) echo Invalid date parameter [%1] received by %0
  80. if (%today%)==(ERROR) goto endit
  81.  
  82. echo ───────────────────────────────────────────────────────────────────────────────
  83. FDATE /ff /A%today% /Imm-dd-ccyy /Od1 /P"APPOINTMENTS & THINGS TO DO: "
  84. echo ───────────────────────────────────────────────────────────────────────────────
  85. CALL %TicBAT%
  86.  
  87.  
  88.  
  89. :endit
  90. set ticdat=
  91. set ticmsg=
  92. set TicBAT=
  93.